#!/usr/bin/env python3
"""调试脚本"""
import sys
import os
from src.config import GlobalConfig

project_root = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, project_root)

from src.cli import CLI

def main():
    """调试入口点"""
    # 设置测试工作目录
    GlobalConfig.init('config.ini')
    test_dir = GlobalConfig.get_config('work_dir')
    os.makedirs(test_dir, exist_ok=True)
    # 设置命令行参数
    sys.argv = [
        "cli-tool",
        "--work-dir",
        test_dir
    ]
    
    # 运行CLI
    cli = CLI()
    GlobalConfig.set_cli(cli)
    cli.run()

if __name__ == "__main__":
    main() 